package com.pharmacy.UserManage.service;//package com.pharmacy.UserManage.service;
//
//import com.pharmacy.UserManage.dao.SaleRecordMapper;
//import com.pharmacy.UserManage.entity.SaleRecord;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//import java.util.Date;
//import java.util.List;
//
//@Service
//public class SaleRecordServiceImpl implements SaleRecordService {
//
//    @Autowired
//    private SaleRecordMapper saleRecordMapper;
//
//    @Override
//    public List<SaleRecord> getAllSaleRecords() {
//        return saleRecordMapper.findAllSaleRecords();
//    }
//
//    @Override
//    public List<SaleRecord> getSaleRecordsByCondition(Date startDate, Date endDate, Integer medicineId) {
//        return saleRecordMapper.findSaleRecordsByCondition(startDate, endDate, medicineId);
//    }
//
//    @Override
//    public boolean addSaleRecord(SaleRecord saleRecord) {
//        try {
//            int result = saleRecordMapper.addSaleRecord(saleRecord);
//            return result > 0;
//        } catch (Exception e) {
//            throw new RuntimeException("添加销售记录失败: " + e.getMessage());
//        }
//    }
//
//    @Override
//    public List<SaleRecord> getSalesStatistics(Date startDate, Date endDate) {
//        return saleRecordMapper.getSalesStatistics(startDate, endDate);
//    }
//}
